<template>
  <div>
    <div class="bg-gray-50 mt-8">
      <div class="max-w-7xl mx-auto py-12 px-4 sm:px-6 lg:py-16 lg:px-8 lg:flex lg:items-center lg:justify-between">
        <h2 class="text-3xl font-extrabold tracking-tight text-gray-900 sm:text-4xl">
          <span class="block">{{ message }}</span>
          <span v-if="isSuccess" class="block text-indigo-600">你现在可以登陆了!</span>
        </h2>
        <div class="mt-8 flex lg:mt-0 lg:flex-shrink-0">
          <div class="inline-flex rounded-md shadow">
            <a href="#" @click.prevent="$router.push({'name': 'Login'})"
               class="inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700">
              登陆 </a>
          </div>
          <div class="ml-3 inline-flex rounded-md shadow">
            <a href="#"
               class="inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-medium rounded-md text-indigo-600 bg-white hover:bg-indigo-50">
              返回首页 </a>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import request from "@/http/request";

export default {
  name: "Active",
  data() {
    return {
      token: this.$route.params.token,
      message: '',
      isSuccess: false
    }
  },
  methods: {
    active() {
      request.active(this.token).then(res => {

        if (res.data.status === 200) {
          this.isSuccess = true
        }

        this.message = res.data.message
        console.log(res)

      })
    }
  },
  mounted() {
    this.active()
  }
}
</script>

<style scoped>

</style>